package com.learnyou.server.xingzuo.biz.handle;

import com.learnyou.server.xingzuo.dao.model.WechatContextUtil;
import com.learnyou.server.xingzuo.dto.resultDTO.wechat.WechatBindingUserDTO;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author heweifeng
 * @Description:
 * @date 2022/12/17 11:19
 */
@Aspect
@Component
public class WechatLoginInterceptor {


    @Pointcut(value = "@annotation(com.learnyou.server.xingzuo.biz.handle.annotation.WechatLogin)")
    public void cutService() {
    }

    @Around("cutService()")
    public Object preHandle(ProceedingJoinPoint point) throws Throwable {

//        WechatBindingUserDTO wechatBindingUserDTO = WechatPermissionHelper.checkAndGetWechatUser();
//        WechatContextUtil.setWechatUser(wechatBindingUserDTO);
        return point.proceed();
    }

}
